home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bsrc_p1.arc / B_WAZOO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-30  |  6.1 KB  |  151 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*               The Opus Computer-Based Conversation System                */
  3. /*       (c) Copyright 1987, Wynn Wagner III, All Rights Reserved           */
  4. /*                                                                          */
  5. /*                   YOOHOO is a trademark of Wynn Wagner III               */
  6. /*                                                                          */
  7. /*                            YOOHOO-YOOHOO/2U2 is                          */
  8. /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
  9. /*                                                                          */
  10. /*      This implementation of Chuck Forsberg's ZMODEM protocol was         */
  11. /*                       for Opus by Rick Huebner                           */
  12. /*                with modifications done by Vince Perriello                */
  13. /*                and more modifications done by Bob Hartman                */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*                      BinkleyTerm "WaZOO" Processor                       */
  17. /*                                                                          */
  18. /*                                                                          */
  19. /*  This module is a very simple FOSSIL-based terminal emulator. It is      */
  20. /*  provided for your information only.  You will find routines that need   */
  21. /*  to be coded and identifiers to be resolved. It has been previously      */
  22. /*  known as "OpusLink" and "OConnect". The use of the name "BinkleyTerm"   */
  23. /*  does not preclude the possibility that another "OpusLink" or "OConnect" */
  24. /*  could be released.                                                      */
  25. /*                                                                          */
  26. /*  There is absolutely no guarantee that anything here will work.  If you  */
  27. /*  break this routine, you own both pieces.                                */
  28. /*                                                                          */
  29. /*  USAGE:  You may use this material in any program with no obligation     */
  30. /*          as long as there is no charge for your program.  For more       */
  31. /*          information about commercial use, contact the "OPUSinfo HERE"   */
  32. /*          BBS (124/111).                                                  */
  33. /*                                                                          */
  34. /*                                                                          */
  35. /*--------------------------------------------------------------------------*/
  36.  
  37. #include <signal.h>
  38. #include <ctype.h>
  39. #include <conio.h>
  40.  
  41. #define WAZOO_SECTION
  42. #define MATRIX_SECTION
  43. #include "zmodem.h"
  44.  
  45. #include "com.h"
  46.  
  47.  
  48. extern int pascal send_WaZOO();
  49.  
  50. extern int got_arcmail;
  51. extern int got_bundle;
  52. extern int un_attended;
  53.  
  54. extern byte *request_template;
  55. extern int remote_capabilities;
  56. extern int remote_net, remote_node;
  57. extern int called_net, called_node;
  58.  
  59. extern int get_Zmodem();
  60. extern int send_Zmodem();
  61. int (*wzgetfunc)(), (*wzsendfunc)();
  62.  
  63.  
  64.  
  65. /*--------------------------------------------------------------------------*/
  66. /* WaZOO                                                                    */
  67. /*--------------------------------------------------------------------------*/
  68. void WaZOO( originator )
  69.    int originator;
  70.    begin
  71.       int stat;
  72.       int wztype;
  73.  
  74.  
  75.       /*--------------------------------------------------------------------*/
  76.       /* Initialize WaZOO                                                   */
  77.       /*--------------------------------------------------------------------*/
  78.       stat        =
  79.       got_arcmail =
  80.       got_bundle  = 0;
  81.  
  82.       if (originator && ((remote_net != called_net) || (remote_node != called_node)))
  83.          {
  84.          status_line ("!Called %d/%d and got %d/%d", called_net, called_node,
  85.             remote_net, remote_node);
  86.          }
  87.       else
  88.          {
  89.          called_net = remote_net;
  90.          called_node = remote_node;
  91.          }
  92.  
  93.       if (!CARRIER) return;
  94.  
  95.       /* See if we can both do ZEDZAP */
  96.       if (remote_capabilities & ZED_ZAPPER)
  97.          {
  98.          wztype = ZED_ZAPPER;
  99.          status_line(":WaZOO method: ZedZap");
  100.          wzgetfunc = get_Zmodem;
  101.          wzsendfunc = send_Zmodem;
  102.          }
  103.       else
  104.          {
  105.          wztype = Y_DIETIFNA;
  106.          status_line(":WaZOO method: DietIfna");
  107.          if (originator)
  108.             {
  109.             FTSC_sender(1);
  110.             }
  111.          else
  112.             {
  113.             FTSC_receiver(1);
  114.             }
  115.          return;
  116.          }
  117.  
  118.  
  119.       /*--------------------------------------------------------------------*/
  120.       /* ORIGINATOR: send/receive/send                                      */
  121.       /*--------------------------------------------------------------------*/
  122.       if (originator)
  123.          begin
  124.  
  125.             send_WaZOO();
  126.             if (!CARRIER)                          goto endwazoo;
  127.             if (!(*wzgetfunc)(ctl.filepath, NULL))   goto endwazoo;
  128.  
  129.             if (!CARRIER)                          goto endwazoo;
  130.             stat  = respond_to_file_requests(0);
  131.             (*wzsendfunc)(NULL,NULL,NOTHING_AFTER,((stat)?END_BATCH:NOTHING_TO_DO),DO_WAZOO);
  132.          end
  133.  
  134.       /*--------------------------------------------------------------------*/
  135.       /* CALLED SYSTEM: receive/send/receive                                */
  136.       /*--------------------------------------------------------------------*/
  137.       else
  138.          begin
  139.             if (!(*wzgetfunc)(ctl.filepath, NULL))   goto endwazoo;
  140.             if (!CARRIER)                          goto endwazoo;
  141.             send_WaZOO();
  142.             if (!CARRIER)                          goto endwazoo;
  143.             (*wzgetfunc)(ctl.filepath, NULL);
  144.  
  145.          end
  146.  
  147. endwazoo:
  148.       status_line ("*End of WaZOO Session");
  149.  
  150.    end /* wazoo */
  151.